package com.mdd.front.validate.order;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 订单参数
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "订单请求参数", description = "订单请求参数")
public class OrderParam implements Serializable {

    private static final long serialVersionUID = 1L;

    public interface create {
    }

    public interface update {
    }

    public interface delete {
    }

    @ApiModelProperty(value = "订单ID")
    @NotNull(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Long id;

    @ApiModelProperty(value = "服务ID")
    @NotNull(message = "goodsId参数必传且需大于0", groups = {create.class, update.class})
    private Long goodsId;

    @ApiModelProperty(value = "地址")
    @NotNull(message = "地址不能为null", groups = {create.class, update.class})
    private Long addressId;

    @ApiModelProperty(value = "服务名称")
    private String goodsName; // 服务名称

    @ApiModelProperty(value = "单位名称")
    private String unitName; // 单位名称

    @ApiModelProperty(value = "服务信息")
    //@NotNull(message = "goodsSnap参数缺失", groups = {create.class})
    private String goodsSnap; // 服务信息

    @ApiModelProperty(value = "订单号")
    private String sn;

    @ApiModelProperty(value = "用户ID")
    private Long userId;

    // 第三方交易流水号
    @ApiModelProperty(value = "第三方交易流水号")
    private String transactionId;

    // 师傅id
    @ApiModelProperty(value = "师傅ID")
    private Long staffId;

    // 订单类型
    @ApiModelProperty(value = " 订单类型;0-普通订单;")
    private Integer orderType;

    // 订单来源
    @ApiModelProperty(value = " 订单来源;1-微信小程序;2-微信公众号;3-手机H5;4-PC;5-苹果app;6-安卓app;")
    private Integer orderTerminal;

    // 订单状态
    @ApiModelProperty(value = "订单状态;0-待支付;1-预约中;2-服务中;3-已完成;4-已关闭;5-立即预约")
    private Integer orderStatus;

    // 支付状态
    //@NotNull(message = "payStatus参数缺失", groups = {create.class, update.class})
    //@DecimalMin(value = "0", message = "payStatus参数值不能少于0", groups = {create.class, update.class})
    @ApiModelProperty(value = "支付状态;0-待支付;1-已支付;")
    private Integer payStatus;

    // 支付方式
    //@NotNull(message = "payWay参数缺失", groups = {create.class, update.class})
    //@DecimalMin(value = "0", message = "payWay参数值不能少于0", groups = {create.class, update.class})
    @ApiModelProperty(value = "支付方式:1-微信支付;2-支付宝支付;3-余额支付;")
    private Integer payWay;

    @ApiModelProperty(value = "服务价格")
    private BigDecimal goodsPrice;

    @ApiModelProperty(value = "订单金额")
    private BigDecimal orderAmount;

    @ApiModelProperty(value = "总金额")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "总数量")
    private Integer totalNum;

    //@NotNull(message = "userRemark参数缺失", groups = {create.class, update.class})
    //@Length(max = 0, message = "userRemark参数不能超出0个字符", groups = {create.class, update.class})
    @ApiModelProperty(value = "用户备注")
    private String userRemark;

    @ApiModelProperty(value = "response的响应参数")
    private String responseData;

    //@NotNull(message = "orderRemarks参数缺失", groups = {create.class, update.class})
    //@Length(max = 0, message = "orderRemarks参数不能超出0个字符", groups = {create.class, update.class})
    @ApiModelProperty(value = "订单备注")
    private String orderRemarks;

    //@NotNull(message = "verificationCode参数缺失", groups = {create.class, update.class})
    //@Length(max = 20, message = "verificationCode参数不能超出20个字符", groups = {create.class, update.class})
    @ApiModelProperty(value = "核销码")
    private String verificationCode;

    //@NotNull(message = "verificationStatus参数缺失", groups = {create.class, update.class})
    //@DecimalMin(value = "0", message = "verificationStatus参数值不能少于0", groups = {create.class, update.class})
    @ApiModelProperty(value = "核销状态:1已核销 0待核销")
    private Integer verificationStatus;

    private String contact;

    @ApiModelProperty(value = "联系电话")
    private String mobile;

    @ApiModelProperty(value = "省")
    private Long provinceId;

    @ApiModelProperty(value = "市")
    private Long cityId;

    @ApiModelProperty(value = "区/县id")
    private Long districtId;

    @ApiModelProperty(value = "详细地址")
    private String address;

    // 是否派单
    //@NotNull(message = "isDispatch参数缺失", groups = {create.class, update.class})
    //@IntegerContains(values = {0, 1}, message = "isDispatch参数值不在符合范围", groups = {create.class, update.class})
    @ApiModelProperty(value = "是否派单:1是 0否")
    private Integer isDispatch;

    //@NotNull(message = "payTime参数缺失", groups = {create.class, update.class})
    //@DecimalMin(value = "0", message = "payTime参数值不能少于0", groups = {create.class, update.class})
    @ApiModelProperty(value = "支付时间")
    private Long payTime;

    //@NotNull(message = "cancelTime参数缺失", groups = {create.class, update.class})
    //@DecimalMin(value = "0", message = "cancelTime参数值不能少于0", groups = {create.class, update.class})
    @ApiModelProperty(value = "取消时间")
    private Long cancelTime;

    @ApiModelProperty(value = "预约开始时间")
    @NotNull(message = "appointTimeStart参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "appointTimeStart参数值不能少于0", groups = {create.class, update.class})
    private Long appointTimeStart;

    @ApiModelProperty(value = "预约结束时间")
    @NotNull(message = "appointTimeEnd参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "appointTimeEnd参数值不能少于0", groups = {create.class, update.class})
    private Long appointTimeEnd;

    //@NotNull(message = "finishTime参数缺失", groups = {create.class, update.class})
    //@DecimalMin(value = "0", message = "finishTime参数值不能少于0", groups = {create.class, update.class})
    @ApiModelProperty(value = "完成时间")
    private Long finishTime;

    @ApiModelProperty("优惠券id")
    private List<Integer> couponId;

    @ApiModelProperty("是否是团购订单")
    private Integer isBuy;

    @ApiModelProperty("团购主id")
    private Integer orderId;

    @ApiModelProperty("拉新人员id")
    private Integer scanUserId;

    @ApiModelProperty("是否是免费的拉新服务")
    private Integer isGratis;
}
